using System;
using System.Data;
using System.Collections.Generic;
using WeFrame.Core.Common;
using WeFrame.Core.DAL;
using WeFrame.Core.Model;
using WeFrame.Test.Model;
using WeFrame.Test.DAL;

namespace WeFrame.Test.BLL
{
    /// <summary>
    /// 管理员信息表
    /// </summary>
    public partial class TestStudentBLL
    {

        private readonly TestStudentDAL dal;
        public TestStudentBLL()
        {
            dal = new TestStudentDAL();
        }

        #region 基本方法=============================

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id)
        {
            return dal.Exists(id);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(TestStudentEntity model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(TestStudentEntity model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }


        public void Delete(string ids)
        {
            string[] idArray= ids.Split(',');
            foreach (string id in idArray) 
            {
                this.Delete(int.Parse(id));
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public TestStudentEntity GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 查询对象集合
        /// </summary>
        /// <param name="queryParamList">查询条件集合</param>
        /// <param name="queryOrderList">排序条件集合</param>
        /// <param name="queryPage">分页</param>
        /// <returns>数据集合</returns>
        public DataSet QueryDataSet(List<QueryParam> queryParamList, List<QueryOrder> queryOrderList, QueryPage queryPage) 
        {
            return dal.QueryDataSet(queryParamList, queryOrderList, queryPage);
        }

        #endregion
    }
}

